package cn.ctodb.divination.domain;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * A Sancai.
 */
@Entity
@Table(name = "sancai")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "sancai")
public class Sancai implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "title")
    private String title;

    @Column(name = "yy")
    private String yy;

    @Column(name = "jx")
    private String jx;

    @Lob
    @Column(name = "content")
    private String content;

    @Lob
    @Column(name = "jcy")
    private String jcy;

    @Column(name = "jx_1")
    private String jx1;

    @Lob
    @Column(name = "cgy")
    private String cgy;

    @Column(name = "jx_2")
    private String jx2;

    @Lob
    @Column(name = "rjgx")
    private String rjgx;

    @Column(name = "jx_3")
    private String jx3;

    @Lob
    @Column(name = "xg")
    private String xg;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public Sancai title(String title) {
        this.title = title;
        return this;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getYy() {
        return yy;
    }

    public Sancai yy(String yy) {
        this.yy = yy;
        return this;
    }

    public void setYy(String yy) {
        this.yy = yy;
    }

    public String getJx() {
        return jx;
    }

    public Sancai jx(String jx) {
        this.jx = jx;
        return this;
    }

    public void setJx(String jx) {
        this.jx = jx;
    }

    public String getContent() {
        return content;
    }

    public Sancai content(String content) {
        this.content = content;
        return this;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getJcy() {
        return jcy;
    }

    public Sancai jcy(String jcy) {
        this.jcy = jcy;
        return this;
    }

    public void setJcy(String jcy) {
        this.jcy = jcy;
    }

    public String getJx1() {
        return jx1;
    }

    public Sancai jx1(String jx1) {
        this.jx1 = jx1;
        return this;
    }

    public void setJx1(String jx1) {
        this.jx1 = jx1;
    }

    public String getCgy() {
        return cgy;
    }

    public Sancai cgy(String cgy) {
        this.cgy = cgy;
        return this;
    }

    public void setCgy(String cgy) {
        this.cgy = cgy;
    }

    public String getJx2() {
        return jx2;
    }

    public Sancai jx2(String jx2) {
        this.jx2 = jx2;
        return this;
    }

    public void setJx2(String jx2) {
        this.jx2 = jx2;
    }

    public String getRjgx() {
        return rjgx;
    }

    public Sancai rjgx(String rjgx) {
        this.rjgx = rjgx;
        return this;
    }

    public void setRjgx(String rjgx) {
        this.rjgx = rjgx;
    }

    public String getJx3() {
        return jx3;
    }

    public Sancai jx3(String jx3) {
        this.jx3 = jx3;
        return this;
    }

    public void setJx3(String jx3) {
        this.jx3 = jx3;
    }

    public String getXg() {
        return xg;
    }

    public Sancai xg(String xg) {
        this.xg = xg;
        return this;
    }

    public void setXg(String xg) {
        this.xg = xg;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Sancai sancai = (Sancai) o;
        if (sancai.id == null || id == null) {
            return false;
        }
        return Objects.equals(id, sancai.id);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "Sancai{" +
            "id=" + id +
            ", title='" + title + "'" +
            ", yy='" + yy + "'" +
            ", jx='" + jx + "'" +
            ", content='" + content + "'" +
            ", jcy='" + jcy + "'" +
            ", jx1='" + jx1 + "'" +
            ", cgy='" + cgy + "'" +
            ", jx2='" + jx2 + "'" +
            ", rjgx='" + rjgx + "'" +
            ", jx3='" + jx3 + "'" +
            ", xg='" + xg + "'" +
            '}';
    }
}
